﻿<?php
/*===============================获取物流=================================*/
if($_REQUEST['call'] == 'yundan')
{
	get_wuliu(htmldecode2($_GET['express']), htmldecode2($_GET['content']), 'exit');
}
if($_REQUEST['call'] == 'yundan_mobile')
{
	$wuliu_data = get_wuliu(htmldecode2($_GET['express']), htmldecode2($_GET['content']), 'return');
	echo 'backdata('.json_encode($wuliu_data).')';
}
function get_wuliu($express = '', $content = '', $way = 'exit')
{
	require_once("zto/service.php");
	if($way == 'return')
	{
		return get_zto_data('mail.trace', $content, $way);
	}else{
		get_zto_data('mail.trace', $content, $way);
	}	
}

/*===============================批量下单和获取大头笔，从而获取中通快递单号和大头笔=================================*/
function get_order_data($func = 'mail.trace', $content, $way = 'return')
{
  if($content)
  {
	  require_once("zto/service.php");
	  return get_zto_data($func, $content, $way);
  }
}
function htmldecode2($str) {  
 if (empty($str) || "" == $str){ return ""; }  
   
 $str = strip_tags ( $str );  
 $str = htmlspecialchars ( $str );  
 $str = nl2br ( $str );  
 $str = str_replace ( "?", "", $str ); 
 $str = str_replace ( "'", "", $str ); 
 $str = str_replace ( "\"", "", $str );  
 $str = str_replace ( "!", "", $str );  
 $str = str_replace ( "$", "", $str );  
 $str = str_replace ( "%", "", $str );  
 $str = str_replace ( "^", "", $str );  
 $str = str_replace ( "select", "", $str );  
 $str = str_replace ( "join", "", $str );  
 $str = str_replace ( "union", "", $str );  
 $str = str_replace ( "insert", "", $str );  
 $str = str_replace ( "delete", "", $str );  
 $str = str_replace ( "update", "", $str );  
 $str = str_replace ( "drop", "", $str );  
 $str = str_replace ( "create", "", $str );  
 $str = str_replace ( "modify", "", $str );  
 $str = str_replace ( "rename", "", $str );  
 $str = str_replace ( "alter", "", $str );  
 $str = str_replace ( "cast", "", $str ); 
 $str = str_replace ( "like", "", $str );
 $str = str_replace ( "where", "", $str );    
 return $str;  
}
?>